using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class PT_ToolKMGTManagerBase
    {
        public PT_ToolKMGTManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity Insert(PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity Update(PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity UpdateWithCondition(PT_ToolKMGTEntity obj,PT_ToolKMGTEntity objCond)
        { 
            return (PT_ToolKMGTEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public PT_ToolKMGTEntity Delete(PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.Delete(obj);             
        }
 
 
        public PT_ToolKMGTEntity DeleteWithCondition(PT_ToolKMGTEntity objCond)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCode (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Code");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Code 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCode (string Code )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Code = Code;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Code");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCreatedBy (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedBy 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCreatedBy (string CreatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedBy = CreatedBy;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCreatedDate (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedDate 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByCreatedDate (DateTime CreatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedDate = CreatedDate;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteById (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteById (int Id )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Id = Id;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByIsActive (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"IsActive");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IsActive 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByIsActive (bool IsActive )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsActive = IsActive;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"IsActive");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByIsDeleted (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"IsDeleted");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IsDeleted 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByIsDeleted (bool IsDeleted )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsDeleted = IsDeleted;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"IsDeleted");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByName (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Name");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Name 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByName (string Name )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Name = Name;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"Name");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByUpdatedBy (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedBy 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByUpdatedBy (string UpdatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedBy = UpdatedBy;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByUpdatedDate (PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedDate 
        /// </summary>
        /// <returns>PT_ToolKMGTEntity</returns>
        public PT_ToolKMGTEntity DeleteByUpdatedDate (DateTime UpdatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedDate = UpdatedDate;  
            return (PT_ToolKMGTEntity)Adapter.DeleteByField(obj,"UpdatedDate");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public PT_ToolKMGTEntity Select(PT_ToolKMGTEntity obj)
        { 
            return (PT_ToolKMGTEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_ToolKMGTEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_ToolKMGTEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new PT_ToolKMGTEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new PT_ToolKMGTEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_ToolKMGTEntity> SelectAllLST()
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_ToolKMGTEntity()),new PT_ToolKMGTEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_ToolKMGTEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_ToolKMGTEntity(),option),new PT_ToolKMGTEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCode (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"Code");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCode (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Code",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCodeLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Code"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCodeLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Code",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCode (string Code )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Code = Code;  
            return Adapter.SelectByField(obj,"Code");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCode (string Code, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Code = Code;  
            return Adapter.SelectByField(obj,"Code",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCodeLST (string Code )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Code = Code;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Code"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Code duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCodeLST (string Code, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Code = Code;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Code",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CreatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedByLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedByLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CreatedBy",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (string CreatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedBy = CreatedBy;  
            return Adapter.SelectByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (string CreatedBy, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedBy = CreatedBy;  
            return Adapter.SelectByField(obj,"CreatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedByLST (string CreatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedBy = CreatedBy;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedByLST (string CreatedBy, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedBy = CreatedBy;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CreatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedDateLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedDateLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CreatedDate",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (DateTime CreatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedDate = CreatedDate;  
            return Adapter.SelectByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (DateTime CreatedDate, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedDate = CreatedDate;  
            return Adapter.SelectByField(obj,"CreatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedDateLST (DateTime CreatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedDate = CreatedDate;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByCreatedDateLST (DateTime CreatedDate, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.CreatedDate = CreatedDate;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIdLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIdLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (int Id )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (int Id, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIdLST (int Id )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Id = Id;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIdLST (int Id, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Id = Id;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsActive (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"IsActive");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsActive (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"IsActive",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIsActiveLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsActive"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIsActiveLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"IsActive",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsActive (bool IsActive )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsActive = IsActive;  
            return Adapter.SelectByField(obj,"IsActive");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsActive (bool IsActive, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsActive = IsActive;  
            return Adapter.SelectByField(obj,"IsActive",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIsActiveLST (bool IsActive )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsActive = IsActive;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsActive"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsActive duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIsActiveLST (bool IsActive, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsActive = IsActive;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsActive",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsDeleted (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"IsDeleted");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsDeleted (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"IsDeleted",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIsDeletedLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsDeleted"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByIsDeletedLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"IsDeleted",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsDeleted (bool IsDeleted )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsDeleted = IsDeleted;  
            return Adapter.SelectByField(obj,"IsDeleted");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIsDeleted (bool IsDeleted, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsDeleted = IsDeleted;  
            return Adapter.SelectByField(obj,"IsDeleted",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIsDeletedLST (bool IsDeleted )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsDeleted = IsDeleted;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsDeleted"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IsDeleted duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByIsDeletedLST (bool IsDeleted, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.IsDeleted = IsDeleted;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IsDeleted",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByName (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"Name");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByName (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Name",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByNameLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Name"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByNameLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Name",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByName (string Name )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Name = Name;  
            return Adapter.SelectByField(obj,"Name");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByName (string Name, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Name = Name;  
            return Adapter.SelectByField(obj,"Name",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByNameLST (string Name )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Name = Name;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Name"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Name duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByNameLST (string Name, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.Name = Name;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Name",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"UpdatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedByLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedByLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"UpdatedBy",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (string UpdatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedBy = UpdatedBy;  
            return Adapter.SelectByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (string UpdatedBy, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedBy = UpdatedBy;  
            return Adapter.SelectByField(obj,"UpdatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedByLST (string UpdatedBy )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedBy = UpdatedBy;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedByLST (string UpdatedBy, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedBy = UpdatedBy;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (PT_ToolKMGTEntity obj)
        { 
            return Adapter.SelectByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"UpdatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedDateLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedDateLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"UpdatedDate",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (DateTime UpdatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedDate = UpdatedDate;  
            return Adapter.SelectByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (DateTime UpdatedDate, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedDate = UpdatedDate;  
            return Adapter.SelectByField(obj,"UpdatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedDateLST (DateTime UpdatedDate )
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedDate = UpdatedDate;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate"),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_ToolKMGTEntity> SelectByUpdatedDateLST (DateTime UpdatedDate, SelectOptions option)
        { 
            PT_ToolKMGTEntity obj = new PT_ToolKMGTEntity();
            obj.UpdatedDate = UpdatedDate;  
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate",option),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectWithConditionLST (PT_ToolKMGTEntity obj)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new PT_ToolKMGTEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_ToolKMGTEntity></returns>
        public List<PT_ToolKMGTEntity> SelectWithConditionLST (PT_ToolKMGTEntity obj,SelectOptions option)
        { 
            return  (List<PT_ToolKMGTEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new PT_ToolKMGTEntity());
        }

}
}
